package ltd.hxya.novel.book.controller;

import ltd.hxya.novel.book.service.impl.WordAnalysisServiceImpl;
import ltd.hxya.novel.common.bean.Result;
import ltd.hxya.novel.entity.rowdata.WordAnalysis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/book/word")
public class WordAnalysisController {

    @Autowired
    private WordAnalysisServiceImpl wordAnalysisService;

    @GetMapping("/listByCategory")
    public Result<List<WordAnalysis>> wordCategoryList(@RequestParam("category") String category){
        List<WordAnalysis> wordAnalysisList = wordAnalysisService.getListByCategory(category);
        return Result.success(wordAnalysisList);
    }

}
